#include "listadddialog.h"
#include "ui_listadddialog.h"

ListAddDialog::ListAddDialog(QWidget *parent, int type) :
    QWidget(parent),
    ui(new Ui::ListAddDialog)
{
    this->type = type;
    ui->setupUi(this);
}

ListAddDialog::~ListAddDialog()
{
    delete ui;
}

void ListAddDialog::on_pushButton_clicked()
{
    switch (this->type) {
    case 1:
        emit sendInsertListItemText(ui->nameInput->text());
        break;
    default:
        emit sendAddListItemText(ui->nameInput->text());
        break;
    }
    this->close();
}
